package com.company.cloud.tenant.modules.api.request;

import com.company.cloud.common.bean.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

@Getter
@Setter
public class TenantAddRequest extends BaseParam {

    @ApiModelProperty(value = "租户编号")
    private String tenantCode;

    @ApiModelProperty(value = "公司名称" ,required = true)
    @NotEmpty(message = "公司名称不能为空")
    private String name;

    @ApiModelProperty(value = "公司简称")
    private String shortName;

    @ApiModelProperty(value = "公司分类")
    private String type;

    @ApiModelProperty(value = "公司Logo")
    private String logo;

    @ApiModelProperty(value = "公司来源分类")
    private String sourceType;


    @ApiModelProperty(value = "公司来源")
    private String source;

    //

    @ApiModelProperty(value = "公司联系人")
    private String linkManName;

    @ApiModelProperty(value = "公司联系人手机号")
    private String linkManMobile;

    @ApiModelProperty(value = "公司联系人电话")
    private String linkManTel;

    @ApiModelProperty(value = "状态[CompanyState]" ,required = true)
    @NotEmpty(message = "状态不能为空")
    private String state ;

    @ApiModelProperty(value = "开通时间(yyyy-MM-dd HH:mm:ss)")
    private String openTime;

    @ApiModelProperty(value = "截止时间(yyyy-MM-dd HH:mm:ss)")
    private String endTime;

    @ApiModelProperty(value = "使用用户人数")
    private Integer useUserNum=5;

    @ApiModelProperty(value = "开通服务")
    private List<TenantOpenServiceItem> openItems;

    @ApiModelProperty(value = "经纬度类型")
    private String llType;


    @ApiModelProperty(value = "经度")
    private Double longitude;


    @ApiModelProperty(value = "纬度")
    private Double latitude;


    @ApiModelProperty(value = "公司地址")
    private String addr;


    @ApiModelProperty(value = "标签")
    private Set<String> tags;


    @ApiModelProperty(value = "简介")
    private String memo;


    @ApiModelProperty(value = "详情")
    private String detail;


    @ApiModelProperty(value = "排序")
    private Integer orders=0;


    @ApiModelProperty(value = "扩展字段1")
    private String extendOne;


    @ApiModelProperty(value = "扩展字段2")
    private String extendTwo;


    @ApiModelProperty(value = "扩展字段3")
    private String extendThree;


    @ApiModelProperty(value = "扩展字段4")
    private String extendFour;

    @ApiModelProperty(value = "扩展字段5")
    private String extendFive;

    @ApiModelProperty(value = "图片")
    private List<TenantImageItem> images;

    @ApiModelProperty(value = "操作人用户ID")
    private Integer opUserId;

    @ApiModelProperty(value = "操作人操作IP")
    private String opIp;


    public void addOpenItem(TenantOpenServiceItem item) {
        if(this.openItems==null) {
            this.openItems=new ArrayList<TenantOpenServiceItem>();
        }
        if(item!=null) {
            this.openItems.add(item);
        }
    }


}
